function fn1(a,b,c){
  console.log('this',this);
  console.log(a,b,c);
  return 'fn'
}
const fn2=fn1.bind({x:100},1,2,3)
console.log(fn2()); 
//模拟bind
Function.prototype.bind1=function(){
  //将参数拆为数组
  const args=Array.from(arguments)
  //获取this(数组第一项)
  const t=args.shift()
  const self=this;
  //返回一个函数
  return function(){
    return self.apply(t,args)
  }
}

const fn3=fn1.bind({x:100},1,2,3)
console.log(fn3()); 